import PropTypes from 'prop-types'
import React, { memo } from 'react'
import RoomItem from '@/components/room-item'
import SectionHeader from '@/components/section-header'
import { SectionV1Wrapper } from './style'
import SectionFooter from '@/components/section-footer'

const HomeSectionV1 = memo(props => {
  const { infoData } = props
  return (
    <SectionV1Wrapper>
      <SectionHeader title={infoData.title} subtitle={infoData.subtitle} />
      <ul className='room-list'>
        {infoData.list?.slice(0, 8).map(item => (
          <RoomItem itemData={item} key={item.id} />
        ))}
      </ul>
      <SectionFooter></SectionFooter>
    </SectionV1Wrapper>
  )
})

HomeSectionV1.propTypes = {
  infoData: PropTypes.object
}

export default HomeSectionV1
